package com.biglead.wx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biglead.wx.mapper.WxAppInfoMapper;
import com.biglead.wx.pojo.WxAppInfo;
import com.biglead.wx.service.WxAppInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class WxAppInfoServiceImpl extends ServiceImpl<WxAppInfoMapper, WxAppInfo> implements WxAppInfoService {
    @Override
    public WxAppInfo queryByAppId(String appId) {
        WxAppInfo orderInfo = this.getOne(new LambdaQueryWrapper<WxAppInfo>().eq(WxAppInfo::getAppId, appId));
        if (orderInfo == null) {
            throw new RuntimeException("未查询到小程序");
        }
        return orderInfo;
    }
}
